package com.ktg.mes.md.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ktg.common.annotation.Excel;
import com.ktg.common.core.domain.BaseEntity;
import com.ktg.common.core.domain.treeSelectInterface;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 单位对象 md_unit_measure
 *
 * @author ruoyi
 * @date 2022-04-27
 */
@Data
@Accessors(chain = true)
@TableName("md_statistics_type")
public class MdStatistics extends BaseEntity implements treeSelectInterface
{
    private static final long serialVersionUID = 1L;

    /** 单位ID */
    @TableId(value = "statistics_id", type = IdType.AUTO)
    private Long statisticsId;

    /** 单位名称 */
    @Excel(name = "单位名称")
    private String statisticsName;

    /** 排列顺序 */
    @Excel(name = "排列顺序")
    private Integer orderNum;

    /** 是否启用 */
    @Excel(name = "是否启用")
    private String enableFlag;

    /** 外观 */
    @Excel(name = "外观")
    private String appearance;

    /** 统计分类重量 */
    @Excel(name = "统计分类重量")
    private Long statisticsQuantity;

    /** 预留字段1 */
    @Excel(name = "预留字段1")
    private String attr1;

    /** 预留字段2 */
    @Excel(name = "预留字段2")
    private String attr2;

    /** 预留字段3 */
    @Excel(name = "预留字段3")
    private Long attr3;

    /** 预留字段4 */
    @Excel(name = "预留字段4")
    private Long attr4;

    /** 统计分类BOM字符 */
    @Excel(name = "统计分类BOM字符")
    private String statisticsTypeBomString;

    private Long parentTypeId;


    /** 祖级列表 */
    private String ancestors;

    /** 分类类型 */  // Y item  N product
    private String itype;


    @TableField(exist = false)
    private List<MdStatistics> children = new ArrayList<MdStatistics>();

    @Override
    public Long getTreeSelectTypeId() {
        return getStatisticsId();
    }

    @Override
    public String getTreeSelectTypeName() {
        return getStatisticsName();
    }

    @Override
    public List getTreeSelectChildren() {
        return getChildren();
    }

}
